#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 5e5 + 5;

int n, k, p;
int a[N];
int nxt[N];
int pos[N];
int inq[N];
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n >> k >> p;
  rep(i, 1, p) cin >> a[i];
  rep(i, 1, n) pos[i] = p + 1;
  per(i, p, 1) {
    nxt[i] = pos[a[i]];
    pos[a[i]] = i;
  }
  priority_queue<int> pq;
  int cnt = 0;
  rep(i, 1, p) {
    if (!inq[i]) {
      cnt++;
      if (cnt > k) {
        int x = pq.top();
        pq.pop();
        inq[x] = 0;
      }
    }
    pq.push(nxt[i]);
    inq[nxt[i]] = 1;
  }
  cout << cnt;
  return 0;
}
